home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_basi / bltq127.zip / !README < prev    next >
Text File  |  1996-11-12  |  29KB  |  603 lines

  1. --------------------------------
  2. Read me first (sharware release)
  3. BULLET v1.2
  4.  
  5. --Documentation (read this before using CZ)
  6.  
  7. The documentation is online in the CZ.COM/CZ.HLP files. To get started just
  8. make sure CZ.HLP is in the current directory and load CZ:
  9.  
  10.    C>cz
  11.  
  12. It can also be loaded high but make sure you have at least 15K of UMB space.
  13. It will load high in as little as 4.5K but will not operate correctly in UMB
  14. without at least 15K. Check out the Using_CZ in the TUTORIAL_INDEX--press
  15. Alt-F1 to hotkey into CZ. Press END (cursor moves to TUTORIAL_INDEX). Press
  16. ENTER. Move the cursor to under Starting_CZ. Press ENTER. Use the END/ENTER
  17. combo to continue until you get the idea. A mouse makes using CZ even easier.
  18.  
  19. If you want to have a hardcopy of the CZ.HLP use the HLP2TXT.EXE program to
  20. strip off the header info. Load it into your favorite WP or text editor.
  21.  
  22. This package is documentation/source-specific to QuickBASIC 4.5 and BASIC 7 in
  23. that much of the source examples deal with using BULLET under these compilers.
  24. Because of this, this version is called BLTQxxx.ZIP.
  25.  
  26.  
  27. --Installation
  28.  
  29. BULLET comes with the BULLET.LIB in compressed form (BULLET.LI_). It must be
  30. installed using the INSTALL.EXE program. INSTALL performs one function: it
  31. decompresses BULLET.LI_ (to BULLET.LIB) and writes installation information
  32. to the BULLET.LIB file. It does nothing else.
  33.  
  34. To install:
  35.  
  36.    C>install
  37.  
  38. The installation process asks two questions and then decompresses the file so
  39. that BULLET.LIB is ready for use. BULLET.LIB is fully-functional and not
  40. crippled. You may use BULLET.LIB and the BULLET package for evaluation only and
  41. for an evaluation period not to exceed 21 days from the date of installation.
  42. BULLET.LIB works with just about every DOS compiler on the market.
  43.  
  44.  
  45. --Registration
  46.  
  47. BULLET is a shareware product. This means that you may try BULLET during the
  48. evaluation period free of obligation. However, you may not use BULLET after
  49. this evaluation period without registering--you must purchase a license to
  50. use BULLET if you wish to continue to use BULLET or any programs produced with
  51. BULLET. See the !ORDER.FRM for ordering information by check, cash, or money
  52. order. Use !ORDER.CC for ordering by credit card.
  53.  
  54. For alternate payment options, see !ORDER.BMT.
  55.  
  56.  
  57. --Upgrades and Updates, Site licensing
  58.  
  59. All updates and upgrades are available from the support BBS free-of-charge.
  60. See the PRODUCT_SUPPORT heading under TUTORIAL_INDEX in CZ for more.
  61.  
  62. Site licensing is available at reasonable rates. Contact me for details.
  63.  
  64.  
  65. --Distribution
  66.  
  67. BBS Sysops may carry BULLET on their BBS provided that all files listed in
  68. the !PACKLST file are included in the archive. This file must be provided
  69. free of charge, i.e., this file cannot placed in an area that requires users
  70. to pay a fee for per-file download. A general subscription fee BBS is exempt
  71. from this limitation, provided that no specific charge is assessed to this
  72. particular file.
  73.  
  74. Shareware distributors/catalog vendors may carry BULLET on their inventory
  75. provided that: the BULLET package be the only software on the diskette, that
  76. it be made clear that the purchase of the disk does not constitute purchase
  77. of the product, and that no charge greater than a reasonable amount for
  78. distribution services be charged (for example, not more than 5 dollars).
  79. CD-ROM vendors may include BULLET and may charge more than $5 for the CD,
  80. provided that the CD is not for the sole or primary purpose of distributing
  81. Bullet.
  82.  
  83. Only the shareware version of Bullet may be distributed without explicit
  84. permission from the author.
  85.  
  86. In any case, the author of BULLET may at anytime request (and must be granted)
  87. that the BULLET package be no longer advertised/distributed in the vendors
  88. catalog and that within a reasonable time after request, advertising of BULLET
  89. will end (within 6 months and distribution will end immediately). (Basically,
  90. this means that you as a shareware vendor may include BULLET in your
  91. advertising/distributing but that that I, as the author and owner of BULLET,
  92. have the option of having you stop advertising/distributing BULLET, for
  93. whatever reason (such as it becoming a non-shareware commercial product).)
  94.  
  95.  
  96. --------------------------------------------------------
  97. Status value return code with transaction-based routines
  98.  
  99. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, and all LockXB
  100. routines, do not return the completion status. The return value is the
  101. pack index number that failed. The following example assumes that you are
  102. using multiple index files. If you're not, replace AP(x).y with AP.y.
  103.  
  104.    AP(1).Func = InsertXB   'assume other AP()s setup with .nextPtr
  105.    pid = BULLET(AP(1))
  106.    IF pid = 0 THEN
  107.       IF AP(1).stat = 0 THEN
  108.          'all okay
  109.       ELSE                      'error while adding the data record is returned
  110.          stat = AP(1).stat      'in AP(1).stat if and only if pid=0
  111.          DoErrorWithDataRecord stat
  112.       ENDIF
  113.    ELSE
  114.       stat = AP(pid).stat       'pid is a 1-based value (1...)
  115.       DoErrorWithIndexFile pid, stat
  116.    ENDIF
  117.  
  118. For complete information consult the above named routines in CZ. Note that
  119. ReindexXB does not operate on a data file separately so if its return
  120. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  121. routines, if pid > number_of_packs then the lock on the data file failed.
  122. The following example assumes that a single index file and data file are
  123. to be locked.
  124.  
  125.    packs = 2                    '2 packs (two index files per data file)
  126.    AP(1).Func = LockXB          'assume other AP()s already setup
  127.    pid = BULLET(AP(1))
  128.    IF pid = 0 THEN
  129.       'all okay
  130.    ELSEIF pid <= packs          'error while locking index file and error code
  131.       stat = AP(pid).stat       'in AP(pid).stat
  132.       DoErrorWithIndexFile stat
  133.    ELSE                         'error while locking data file and error code
  134.       stat = AP(1).stat         'also in AP.stat (in FIRST AP pack)
  135.       DoErrorWithDataFile stat  '(i.e., if here then pid=3)
  136.    ENDIF
  137.  
  138.  
  139. ---------------
  140. Troubleshooting
  141.  
  142. Common problems encountered by new users of Bullet are:
  143.  
  144. Q: Common problem?
  145. A: Be sure to memset (set to 0) any unused data bytes.
  146.  
  147. P: Data fields are skewed, with some fields containing
  148. parts of other fields' data.
  149.  
  150. S: Most of these problems relate to the way C strings are
  151. 0-terminated, while dBASE DBF fields are fixed-length,
  152. and so need not have the \0.  If you are going to use
  153. strcpy, or any other C run-time library that requires
  154. null-terminated strings, then be sure to provide for this
  155. when you define your DBF record.  For example, if you
  156. want two fields, LASTN and FIRSTN, to each have 15
  157. characters, but will be using C strings, define the
  158. fields as 16.  This will allow room for the \0 on your
  159. strings, and give 15 true character places.
  160.  
  161. Often, the case is such that all appears normal when the
  162. DBF file is accessed (i.e., the data fields don't appear
  163. to be skewed), but indexed access is not correct.  This
  164. is because your program code has templated the data
  165. record consistent with what was written (and is read) at
  166. the DBF level.  However, it is not consistent with the
  167. DBF header specifications (written in CreateDXB) and so
  168. any external access to the DBF (including Bullet keyed
  169. access) will not be correct.
  170.  
  171. Skewed data also results when you change either your
  172. program's data structure template of the DBF record, or
  173. your DBF field list definitions, but don't do the same to
  174. both.  The physical record buffer in your program must
  175. exactly match that of the DBF record.  Off the subject a
  176. bit, but possibly on your mind:  yes, you can create all
  177. this on the fly (i.e., not hard-coded fieldnames, etc.),
  178. but it does require that you manage all offsets yourself,
  179. rather than have the compiler do it for you.  A job for a
  180. C++ wrapper, I suppose.  Certainly do'able as I''ve done
  181. it using a BASIC compiler (see IDEMO.*)
  182.  
  183. Another reason for skewed fields is that the compiler is
  184. modifying the alignment of your program's DBF record
  185. structure.  It is imperative that you instruct your
  186. compiler to not modify any Bullet-used structure:
  187. #pragma pack() is used by many compilers.  Consult your
  188. compiler documentation.  For non-Bullet structures,
  189. alignment doesn't matter to Bullet.  Bullet structures
  190. are any of the Bullet packs, and any DBF record
  191. template/buffer/structure that your program uses to
  192. communicate with Bullet.
  193.  
  194. The main point is to ensure that your physical data
  195. record (structure) you use in your C/C++ program exactly
  196. matches, field for field, that of the DBF record on disk.
  197.  
  198.  
  199. P: Error 240 occurs when attempting to index or reindex
  200. when all else seems to be right.
  201.  
  202. S: dBASE specifications require that fieldnames of the
  203. DBF be 0-filled.  Some programs create DBF files that do
  204. adhear to this specification, but instead just null-
  205. terminate the fieldname.  These files must be fixed
  206. before they can be used by Bullet.  When creating Bullet
  207. DBF files, you must 0-fill the fieldnames (11 bytes, 10
  208. bytes data -- byte 11 always=0).  Memset() can be used to
  209. quickly 0-fill the entire fieldlist.
  210.  
  211.  
  212. P: Find an exact match on a GetEqualXB.
  213.  
  214. S: The problem usually stems from index files created to
  215. allow non-unique keys.  Personally, I don't create index
  216. files where the primary key is not unique, but the demand
  217. was there and so Bullet provides for this.  However,
  218. since there's no real way to offer indexing on physically
  219. indentical keys, Bullet adds an enumerator word at the
  220. end of each key (only if the index file is not using
  221. unique keys).  This two enumerator is in high byte/low
  222. byte order, and is incremented for each duplicate key in
  223. the index file.  For example, if KINGM is added as a key,
  224. and is found to be the first such key by Bullet, the
  225. actual physical key is KINGM\0\0, where the enumerator is
  226. the last two bytes (in Motorola-word order for proper
  227. collating).  Upon the next insert of a "KINGM" key,
  228. Bullet uses KINGM\0\1.  And so on.
  229.  
  230. To search for this key, which by the way is 7 bytes long,
  231. and so reported by StatKXB, though logically it is only
  232. the 5 bytes (as in strcpy(keyExp,"SUBSTR(LASTN,1,5)")
  233. with non-unique keys permitted), you must account for
  234. this in your keybuffer.  For example, in your global
  235. scratch keybuffer (or you can use a separate buffer for
  236. each index file, up to you)  you must specify all 7
  237. bytes, not just the first 5.  This because the data at
  238. bytes 6/7 may not equal \0\0 or \0\1, and so these keys
  239. will not be found (error 201).  In this particular case,
  240. where duplicate keys exist, and you want to locate a
  241. KINGM record, you really have no choice but to start with
  242. strcpy(keybuff,"KINGM\0\0", be aware of the "extra" \0
  243. put by the strcpy function) and GetEqualXB, check the
  244. data record returned, and if not the one wanted, do
  245. GetNextXB until the desired record is located (or not).
  246. Alternatively, you could specify "KINGM\255\255" and use
  247. GetEqualXB followed immediately by GetPrevXB (enumerator
  248. \255\255 is the very last possible, and so will never be
  249. found, but will setup the internal gears so that the
  250. GetPrevXB will locate the very last existing "KINGM??").
  251.  
  252.  
  253. All this is really only a concern if you permit duplicate
  254. keys.  The above could be made unique by adding expanding
  255. the key expression.  For example, a key based on
  256. SUBSTR(LNAME,1,5)+SUBSTR(SSN,6,4) would be pretty unique
  257. (first 5 characters of last name followed by last 4 SSN
  258. numbers (used as characters)).
  259.  
  260.  
  261. Q: How do I specify the key I want to find?
  262.  
  263. A:  The keybuffer (AP.keybuffptr locating it) is filled
  264. with whatever data type you want to locate (hence,
  265. keybuffer is of void type).  If you want to locate a
  266. character key, simply specify the key, such as
  267. strcpy(keybuffer,"whatever") (see "Find an exact match on
  268. GetEqualXB", above).  If you are locating a binary key
  269. value, place the binary value, with the appropriate cast,
  270. into the keybuffer: e.g., *((long *)keybuffer) = 5L;.
  271.  
  272.  
  273. These problems are the most frequently expressed to me.
  274. If you are having other problems related to getting
  275. Bullet going, feel free to contact me at the locations
  276. listed under Product Support.  My ability to quickly
  277. respond to your requests is directly related to how
  278. thorough you are in expressing the exact cicumstances of
  279. any problem.
  280.  
  281. Complete sample programs are in short supply.
  282. Experienced C or C++ programmers that would like their
  283. "Bullet wrappers" possibly included in future releases
  284. are requested to contact me.  Additional samples will be
  285. made available on the BBS, available to all.  Of course,
  286. registered Bullet users will have access to the best of
  287. the best, and always have free access to the current
  288. versions of Bullet.
  289.  
  290. When you've done everything and it's still not working,
  291. it's time to read the documentation!
  292.  
  293. -------------------
  294. Questions & Answers
  295.  
  296. Q: What is BULLET?
  297.  
  298. A: BULLET is a library of program modules that together let the programmer
  299.    develop and create software that can manage huge amounts of data on
  300.    disk using the industry-standard DBF data file format. It also uses high-
  301.    speed b-tree index files to manage keyed data file access.
  302.  
  303.  
  304. Q: What compiler is BULLET for?
  305.  
  306. A: BULLET can be used by nearly all DOS compilers. It's written entirely in
  307.    assembly language. Because of this, it does not require any particular
  308.    programming language or compiler vendor. The 4 requirements are listed
  309.    in the !WHATIS.TXT file.
  310.  
  311.  
  312. Q: Why do I need BULLET when all I need to handle are small amounts of data?
  313.  
  314. A: BULLET can deal with a database as small as 1 record or as large as several
  315.    million. While your current needs may be small, your future needs are bound
  316.    to expand. BULLET can work with you now, and later, even if you switch
  317.    development platforms by moving to another compiler. And BULLET is fast,
  318.    it can deal with a database with millions of records as easily as it can
  319.    with just a few.
  320.  
  321.  
  322. Q: But b-tree stuff, isn't that hard?
  323.  
  324. A: Everything associated with maintaining the database, its data files and its
  325.    index files, is done behind-the-scenes by BULLET. You just specify how the
  326.    data record is to look by specifying the number of fields, their lengths and
  327.    types, and then specify how you want your index files to be based.
  328.  
  329.  
  330. Q: So how do I design my data record?
  331.  
  332. A: You probably have a pretty good idea, already. A good way to determine what
  333.    should go into a database is what you want to come out of it. For example,
  334.    if you're doing a mailing list program, you'll want to have at least the
  335.    name, perhaps broken into first name and last. Also you'll need the mailing
  336.    address--4 lines is usually enough, so you'll want 4 separate address line
  337.    fields. Then there's the State and ZIP, possibly even country. That's the
  338.    minimum. It would look something like this:
  339.  
  340.    FIRSTNAME field of 15 characters; LASTNAME field of 19 characters; ADDR1
  341.    field of 34 characters, ADDR2, ADDR3, ADDR4 as ADDR1; State field of 2
  342.    characters, and ZIP a field of 5 (or 9 if ZIP+4) characters. You could
  343.    specify the ZIP as a numeric field if you wanted.
  344.  
  345.    You'll notice that the longest field is 34 characters. Why? Because most
  346.    mailing labels are 3.5 inches, about 34 characters across. Since the first
  347.    name and last are usually put on the same line, their total should be 34.
  348.  
  349.    You'll probably want to add more fields like telephone number, last time
  350.    written to, oh, just about anything that you'd think would be important to
  351.    know. There you go, you've just designed your data record.
  352.  
  353.  
  354. Q: Then what?
  355.  
  356. A: Then decide how you need to access this data. You'll want to access it at
  357.    least by name, so one index you'll want is on the name. While you could
  358.    specify the entire name be used as a key, say LASTNAME+FIRSTNAME, this is
  359.    a bit of overkill. Instead, you may want to use just a portion of the name.
  360.    A good candidate would be SUBSTR(LASTNAME,1,5)+SUBSTR(FIRSTNAME,1,1). This
  361.    sets up a key that's only 6 bytes long. The first method, using all the
  362.    name, would be 34 bytes long. By keeping your keys short you'll keep your
  363.    index files small and your index performance high. And yes, you can also
  364.    mix numeric field types with character field types in your key expressions.
  365.  
  366.  
  367. Q: But what if I have two or more names that are identical, or very similar
  368.    but have these parts of the names the same?
  369.  
  370. A: BULLET lets you specify if your index files allow only unique key entries or
  371.    whether duplicate keys are permitted. When keying on a name you should have
  372.    your index file allow duplicate keys. What BULLET does is number these
  373.    identical keys by adding a suffix to each key (called an enumerator). This
  374.    enumerator allows the index algorithm to treat each key as a different key.
  375.    If you search the index for all matches in the first 6 characters of the
  376.    key (the enumerators will always be different) these similar names will
  377.    be found in consecutive order. To find out if the key you've just accessed
  378.    is the actual person you had in mind, you'd scan the data record associated
  379.    with that key for other information, such as middle initial, address,
  380.    anything that would make that person recognizable from another with a
  381.    similar key. If it isn't what you're looking for, get the next key and data
  382.    record, and so on until the first 6 characters of the key no longer are the
  383.    6 you're looking for.
  384.  
  385.  
  386. Q: So I've got my data record designed and also my primary index file. What
  387.    else should I do?
  388.  
  389. A: Now that the database is designed most of the "unknown" is taken care of.
  390.    What comes next depends on how you, yourself, program. What I often do
  391.    next is detail exactly what I want the output to be. That way, I've got
  392.    the front and the back and just need to do the middle. The middle is where
  393.    the fun's at. You'll be amazed at just how few of your in-the-middle coding
  394.    is spent on managing the database. BULLET takes care of all the little
  395.    details. You just need to give it the data and tell it what to do with
  396.    it. Or you tell it what to get and it comes back with what you requested.
  397.    You then do whatever you want with that data.
  398.  
  399.  
  400. Q: I've looked at the header file and it sure has a lot of commands. You're
  401.    telling me that this is simple?
  402.  
  403. A: Yes. Once you've created your data and index files, those mid-level
  404.    routines are not often used. Almost everything you do in your in-the-middle
  405.    coding will use the high-level routines. The InsertXB and UpdateXB routines
  406.    handle adding new or changing existing data, and the GetFirstXB, GetNextXB,
  407.    etc., routines handle getting the data. 90% of the time these are the
  408.    routines your program will be using.
  409.  
  410.  
  411. Q: What about all those packs? How can I keep them straight?
  412.  
  413. A: The good thing about modern programming langauges is that they let you
  414.    build reusable code. The ideal way to use BULLET is to build reusable
  415.    code objects in your programming langauge of choice and hide the down-and-
  416.    dirty aspects of dealing with the various packs in those objects. For
  417.    example, a create key routine could be written once and that object used
  418.    for all your other programming projects:
  419.  
  420.       DECLARE FUNCTION CreateNewIndex% (filen$, kx$, kflags%, XBlink%)
  421.  
  422.       FUNCTION CreateNewIndex(filename$, kx$, keyflags, XBlink)
  423.  
  424.       DIM CKP AS CreateKeyPack
  425.       DIM TmpFile AS STRING * 80
  426.       DIM TmpExp AS STRING * 136
  427.  
  428.       TmpFile = filename$ + CHR$(0)
  429.       TmpExp = kx$ + CHR$(0)
  430.  
  431.       CKP.Func = CreateKXB
  432.       CKP.FilenamePtrOff = VARPTR(TmpFile)
  433.       CKP.FilenamePtrSeg = VARSEG(TmpFile)
  434.       CKP.KeyExpPtrOff = VARPTR(TmpExp)
  435.       CKP.KeyExpPtrSeg = VARSEG(TmpExp)
  436.       CKP.XBlink = XBlink
  437.       CKP.keyflags = keyflags
  438.       CKP.CodePageID = -1
  439.       CKP.CountryCode = -1
  440.       CKP.CollatePtrOff = 0
  441.       CKP.CollatePtrSeg = 0
  442.       stat = BULLET(CKP)
  443.       CreateNewIndex = stat
  444.  
  445.       END FUNCTION
  446.  
  447.    The TmpFile and TmpExp were used in this QuickBASIC example so that the
  448.    string data is assigned to a fixed-length string. VARSEG/VARPTR operate
  449.    on fixed-length strings identically in both BASIC 7 and QuickBASIC 4.5.
  450.    If you want to forgo this compatibility you could use a var-len string
  451.    and the BASIC SADD() function instead of VARPTR. I find using the
  452.    temporary fixed-length strings just as easy since a CHR$(0) needs to
  453.    be appended to the string in any case. And they are temporary strings--
  454.    as soon as the CreateNewIndex() routine exits, the memory assigned to the
  455.    Tmp strings is released.
  456.  
  457.    So, once you write this create index object, you can reuse it over and
  458.    over again without needing to recode it every time. Just a simple
  459.  
  460.    stat = CreateNewIndex(filename$,keyexpression$,keyflags,XBlink)
  461.  
  462.    is all you need to put in your in-the-middle code. Oh, the key expression,
  463.    keyflags, and XBlink are all explained under CreateKXB in CZ.
  464.  
  465.  
  466. Q: I think I'm getting the hang of it. What's next?
  467.  
  468. A: Jump in and start coding. You may want to look over, maybe even print out,
  469.    one of the example programs. The BB_CAI10.BAS is straight forward, try
  470.    that. If you have any questions, just pop-up CZ. It's all in there.
  471.  
  472.  
  473. Q: Sounds good. But, tell me, what is the first thing I'm likely to muff?
  474.  
  475. A: Nothing serious. Just make sure that your record structure in memory
  476.    reserves the first byte for the delete tag. Also, make sure that the field
  477.    descriptors you assigned when you created the data file match your in-memory
  478.    structure, i.e., if you've created a data file (using CreateDXB) with say, 3
  479.    fields, each 25 characters long, make sure that your in-memory structure is
  480.    also 3 fields, each 25 characters:
  481.  
  482.       TYPE ExampleRecordTYPE
  483.       tag AS STRING * 1
  484.       Field1 AS STRING * 25
  485.       Field2 AS STRING * 25
  486.       Field3 AS STRING * 25
  487.       END TYPE
  488.  
  489.    Note: it is allowable to alias your physical fields but the total length
  490.    must match the total length of the DBF data record. (Alias meaning that
  491.    instead of using Field1 AS STRING * 25, you use Field1a AS STRING 13 and
  492.    Field1b AS STRING 12. Be sure you know what you're doing!--the IDEMO.BAS
  493.    program uses this technique (not in the strict sense of alias) by using a
  494.    single 4000-byte in-memory record since it can't know beforehand what
  495.    structure a random DBF file has.)
  496.  
  497.    Also, the transaction routines (InsertXB, UpdateXB, ReindexXB, and the
  498.    LockXBs) return a transaction index rather than a completion code. Be sure
  499.    to check the documentation for the routines.
  500.  
  501. Q: I'm off.
  502.  
  503. A: So am I, but be sure to...
  504.  
  505.    ...Read the manual! Until you do you can't take full advantage of BULLET.
  506.  
  507.  
  508. ---------------
  509. What is BULLET?
  510.  
  511. If you've been wanting to create the ultimate database program, or just a simple
  512. mailing list to handle your holiday cards, BULLET is the programming library for
  513. you. BULLET is a library module for programmers developing in MS-DOS. What
  514. language you ask? Would you believe most any? That's right, BULLET is designed
  515. to operate as-is with most compilers* available for DOS (DOS 3.3 or above is
  516. required). This is possible because BULLET is written entirely in assembly
  517. langauge. Everything it needs it has built in, so no specific compiler run-time
  518. library is required. Your compiler simply needs to be able to:
  519.  
  520.  1. Perform a far call to an external routine using the Pascal calling
  521.     convention.
  522.  2. Build a parameter pack, as in a C struct or BASIC TYPE, for example.
  523.  3. Pass a single far pointer by value (of the parameter pack) to the external
  524.     routine.
  525.  4. Accept a return integer value from the external routine (optional).
  526.  
  527. BULLET uses high-speed b-tree indexes and the industry-standard DBF data file
  528. format to quickly and easily move data to and from disk. The BULLET API includes
  529. over 65 functions to perform tasks from low-level direct DOS file I/O to
  530. high-level transaction-based updates to network routines that let you control
  531. who has access to your files and when. National Language Support (NLS) is built
  532. into each key file. This allows you to properly sort mixed-case and/or foreign
  533. language alphabets. BULLET supports character keys up to 64 bytes as well as
  534. 16-/32-bit integer keys (signed or unsigned). Index files specify if duplicate
  535. keys are allowed or whether unique keys are to be enforced. And although dBASE
  536. DBF data file compatiblility is standard, you can create non-standard DBF files,
  537. such as having fields contain binary data. Key expressions are specified using
  538. text, as in kx = "SUBSTR(Fieldname,1,10)+Fieldname+SUBSTR(Fieldname,10,3)". Keys
  539. may be composed of up to 16 separate fields, located anywhere within the record.
  540.  
  541. The transaction nature of BULLET greatly simplifies what is required of the
  542. programmer. For example, let's say you have a 100,000-record data file with 12
  543. active index files and need to insert a new record. With BULLET, you simply
  544. build the data record and call the InsertXB routine. InsertXB adds the record to
  545. the data file, builds all 12 keys and inserts each into the appropriate index
  546. file. If an error occured, say, while inserting the 11th key, BULLET
  547. automatically backs-out all changes just made to the key files and data file. As
  548. another example, say, updating an exisiting data record, you'd make any
  549. modifications to the data record and call the UpdateXB routine. UpdateXB updates
  550. the record in the data file and automatically updates all 12 index files. If an
  551. error occured, say, with the 5th key, BULLET automatically backs-out all changes
  552. made to the key files and data file.  In addition, transaction-based network
  553. routines are available. These high-level lock/unlock routines also automatically
  554. handle the necessary reloading and flushing of file headers. And what  about
  555. performance? Read on.
  556.  
  557.  
  558. BULLET is fast! The ReindexXB routine indexes your DBF data files in no time
  559. flat: that 100,000 record .DBF can be completely reindexed in under 30 seconds
  560. on a fast computer system. The InsertXB routine can add 1,000 new records and
  561. keys to that 100,000 record database at a rate of over 50 new inserts per
  562. second. This isn't inserting into an empty database, it's inserting into a
  563. database that's already 100,000 records large. UpdateXB can update
  564. 1,000 records in that database at a rate of 20 updates/second. And what about
  565. access speed? How fast can you get to your data once it's in the database? Real
  566. fast! To access from first key to last all 100,000 keys takes less than
  567. 25 seconds (4500+/sec). That shows how fast you can find keys. To access the
  568. keys and also access each data record associated with that key takes a bit
  569. longer. Accessing all 100,000 keys and records takes just over a minute
  570. (1400+/sec). This is in-order access. Incredible. And if you wanted to access
  571. from the last key to the first (reverse-order), the times are just as fast.
  572. What do you get with the BULLET package?
  573.  
  574.  - The BULLET library module, 19K of code and static data space (small indeed)
  575.  - Sample programs in BASIC and C plus an interactive demo for browsing any DBF
  576.  - QuickBASIC .bi include and C .h header files
  577.  - Over 200K of documentation, source examples, and a tutorial, all online
  578.  - CZ, the 15K online, context-sensitive, hyper-text help manager
  579.  - Royalty-free use of BULLET in your programs
  580.  
  581. Routines by category:
  582.  
  583. SYSTEM: InitXB, ExitXB, AtExitXB, MemoryXB, BreakXB, BackupFileXB, StatHandleXB,
  584. GetExtErrorXB
  585.  
  586. MID-LEVEL RECORD/KEY ACCESS: CreateDXB, OpenDXB, CloseDXB, StatDXB, ReadDHXB,
  587. FlushDHXB, CopyDHXB, ZapDHXB, CreateKXB, OpenKXB, CloseKXB, StatKXB, ReadKHXB,
  588. FlushKHXB, CopyKHXB, ZapKHXB, GetDescriptorXB, GetRecordXB, AddRecordXB,
  589. UpdateRecordXB, DeleteRecordXB, UndeleteRecordXB, PackRecordsXB, FirstKeyXB,
  590. EqualKeyXB, NextKeyXB, PrevKeyXB, LastKeyXB, StoreKeyXB, DeleteKeyXB,
  591. BuildKeyXB, CurrentKeyXB
  592.  
  593. HIGH-LEVEL ACCESS: GetFirstXB, GetEqualXB, GetNextXB, GetPrevXB, GetLastXB,
  594. InsertXB, UpdateXB, ReindexXB
  595.  
  596. NETWORK: LockXB, UnlockXB, LockKeyXB, UnlockKeyXB, LockDataXB, UnlockDataXB,
  597. DriveRemoteXB, FileRemoteXB, SetRetriesXB
  598.  
  599. LOW-LEVEL DOS ACCESS: DeleteFileDOS, RenameFileDOS, CreateFileDOS,
  600. AccessFileDOS, OpenFileDOS, SeekFileDOS, ReadFileDOS, ExpandFileDOS,
  601. WriteFileDOS, CloseFileDOS, MakeDirDOS
  602.  
  603.